package org.example.vo;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.List;

/**
 * Company 源辰信息
 *
 * @author navy
 * @date 2024/6/4
 * Email haijunzhou@hnit.edu.cn
 */
@Data
@Component
@ConfigurationProperties(prefix = "login")
public class LoginProperties {

    boolean enable;
    String userTable;
    String nameColumn;
    String pwdColumn;
    String email;
    String userClass; // driver-class-name
    String sessionKey = "loginedUser";
    String sendMail;  // 发送人的邮件地址
    String encryption; //加密的方式 MD5 SHA
    List<String> InterceptorPath; //未登录界面拦截


    // TODO 无需配置, 不要生成 get set
    Class userClassObject;

    @PostConstruct
    public void init() throws ClassNotFoundException {
        this.userClassObject = Class.forName(userClass);
    }

}
